import shutil
import os

# shutil
#  shell  util,链接用户软件与计算机内核,负责通信




# copy_scource_file = 'D:/python/Demopycharm/Modules_study/psutil模块/psutil模块.py'
# copy_destination_file = 'D:/python/Demopycharm/Everyday_Job/2019_7_8/copy_file.py'

# shutil.copyfile    (copy_scource_file    ,     copy_destination_file)
#                scource (复制的文件路径 )  ,    destination(传到何处目的地路径+'/复制之后的文件名)

# move_scource_file = 'D:/python/Demopycharm/Everyday_Job/2019_7_8/copy_file.py'
# move_destination_file = 'D:/python/Demopycharm/Everyday_Job/20190711shutil_psutil_collections'
# shutil.move        (move_scource_file    ,     move_destination_file)
#                scource(要移动的文件路径)  ,     destination(移动到何处目的地dir)

print(shutil.disk_usage('D:'))
#  usage(total= ---,used= ----,free = ---)
#    D盘的使用情况

# os.remove(move_destination_file+'/copy_file.py')

# shutil.rmtree('dir')
#    可删除 no empty dir

with open('shutil_example.py','w') as pyfile:
    pyfile.write('a=2')
shutil.make_archive('shutil_example.py','zip')
#           将 'shutil_example.py'  压缩成 zip 格式 到 当前目录



